package com.xtaller.sdboot.service.impl;

import com.xtaller.sdboot.entity.IamApplicationPermission;
import com.xtaller.sdboot.mapper.IamApplicationPermissionMapper;
import com.xtaller.sdboot.service.IamApplicationPermissionService;
import com.xtaller.sdboot.core.base.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/** 
* 代码生成 
* @author: Taller  
* @date: 2020-02-07 15:56:33
* @Description: 应用与权限中间表服务实现 
*/ 
@Service 
@Slf4j
public class IamApplicationPermissionServiceImpl extends BaseServiceImpl<IamApplicationPermissionMapper, IamApplicationPermission> implements IamApplicationPermissionService {

    @Transactional(rollbackFor = Exception.class)
    @Override
    public Boolean setPermissions(String id, List<IamApplicationPermission> aps) {
        baseMapper.initPermission(id);
        super.saveBatch(aps, aps.size());
        return true;
    }
}
